/*
 * @Author: shengduiliang 1107722390@qq.com
 * @Date: 2024-05-04 19:56:29
 * @LastEditors: shengduiliang 1107722390@qq.com
 * @LastEditTime: 2024-05-05 17:19:19
 * @FilePath: /treasure/src/ui-components/primary-button/index.tsx
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { View } from "@tarojs/components"
import './index.scss'

interface PrimaryButtonProps {
  text: string
  onClick: () => void
  disabled?: boolean
}

const PrimaryButton = ({text, onClick, disabled} : PrimaryButtonProps) => {
  return (
    <View
      className='primary-button mt-large mh-normal text-center text-primary-bold border-radius-large pv-medium'
      onClick={() => !disabled && onClick()}
      style={disabled ? {opacity: 0.5} : {}}
    >
      {text}
    </View>
  )
}

export default PrimaryButton